import request from "@/util/request.js";

export  const userInfoQueryService = (info) => {
    return  request.post("/user/info",info);
}
export  const userRegisterService = (info) => {
    return  request.post("/user/register",info);
}
export  const userStatusAlterService = (id,flag) => {
    // const params = new URLSearchParams()
    // params.append("id",id)
    // params.append("flag",flag)
    // return  request.post("/user/invalid",params);
    return request({
        url: "/user/invalid",
        method: "POST",
        params: {
            id: id,
            flag: flag,
        }
    });
}

export  const uploadFileService = (data) => {
    // return  request.post("/user/register",headers: { "Content-Type": "multipart/articles-data" },info);
   return  request({
        url: "/user/file/upload",
        method: "POST",
        headers: { "Content-Type": "multipart/articles-data" },
        data,
    });
}
export  const userAddService = (info) => {
    return  request.post("/user/add",info);
}

export  const findUserInfoService = (id) => {
    return  request({
        url: "/user/findUser",
        method: "POST",
        params: {
            id: id
        }
    });
}

export  const alterUserInfoService = (info) => {
    return  request.post("/user/alterUserInfo",info);
}
export const deleteUser=(id)=>{
    return  request({
        url: "/user/deleteUser",
        method: "POST",
        params: {
            id: id
        }
    });
}